package ecom.beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class StockBeanPK implements Serializable {

    @Basic(optional = false)
    @Column(name = "id_product_store", nullable = false)
    private Long idProductStore;
    @Basic(optional = false)
    @Column(name = "id_product", nullable = false)
    private Long idProduct;

    public StockBeanPK() {
    }

    public StockBeanPK(Long idProductStore, Long idProduct) {
        this.idProductStore = idProductStore;
        this.idProduct = idProduct;
    }

    public Long getIdProductStore() {
        return idProductStore;
    }

    public void setIdProductStore(Long idProductStore) {
        this.idProductStore = idProductStore;
    }

    public long getIdProduct() {
        return idProduct;
    }

    public void setIdProduct(Long idProduct) {
        this.idProduct = idProduct;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += idProductStore;
        hash += idProduct;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StockBeanPK)) {
            return false;
        }
        StockBeanPK other = (StockBeanPK) object;
        if (this.idProductStore != other.idProductStore) {
            return false;
        }
        if (this.idProduct != other.idProduct) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ecom.beans.StockBeanPK[idProductStore=" + idProductStore + ", idProduct=" + idProduct + "]";
    }
}
